package chapter6;

import java.util.Scanner;

/****************************************************************
 * Author：icynlau
 * Description: 正多边形的面积
 * Date:2021/4/6
 * ***************************************************************
 */
public class exc6_36 {
	
	public static void main(String[] args) {
		
		Scanner input=new Scanner(System.in);
		
		
		System.out.print("Enter the number of sides: ");
		int n=input.nextInt();
		System.out.print("Enter the side: ");
		double s=input.nextDouble();
		
		System.out.print("The area of pentagon is "+area(n,s));
		
	}
	
	public static double area(int n,double side) {
		
		return (n*Math.pow(side, 2)/(4*Math.tan( Math.PI/n ))   );
		
	}

}
